<template>
    <div>
       <headNav></headNav>
       <div class="head"></div>
       <div class="content">  
             <div class="con_body">
              <div class="art">
                    <div class="art_top">
                        <p class="art_tit">{{info.title}}</p>
                        <p class="date">发布时间：{{info.created_at}}</p>
                    </div>
                    <div class="art_mid">
                        <div v-if="info.type=='1'">
                            <video   controls  style="width:100%;height:100%" :src="info.files[0].full_file_path"></video>
                        </div>
                        <div v-if="info.type=='0'">
                            <div v-for="(item,index) in info.files" :key="index">
                                <img :src="item.full_file_path" style="width:100%;height:auto;" />
                            </div>
                      </div>

                    </div>
                    <div class="art_bottom">
                        <div class="dr_div">
                           <div class="auth">作者：<span style="font-weight: normal;">{{info.author}}</span></div>
                           <template v-if="info.talent_id!==0">
                                 <div class="whdr" v-if="info.talent_id==1">文化达人</div>
                                 <div class="whdr" v-if="info.talent_id==2">科学达人</div>
                                 <div class="whdr" v-if="info.talent_id==3">运动达人</div>
                                 <div class="whdr" v-if="info.talent_id==4">劳动达人</div>
                                 <div class="whdr" v-if="info.talent_id==5">艺术达人</div>
                           </template>
                        </div>
                        <div class="auth_lm" v-if="info.user&&info.user.is_school==0"><span style="font-weight: normal;"></span></div>
                        <div class="auth" v-else>学校：<span style="font-weight: normal;">{{info.school}}</span></div>
                       
                        <div  class="auth">作品介绍:</div>
                        <p class="desp">{{info.description}}</p>
                    </div>
               </div>
             </div>
        </div>
       <footCom></footCom>
       
    </div>
  </template>
  
  <script>
import footCom from '@/common/foot.vue';
import headNav from '@/common/headNav.vue';

export default {
    name: 'workDetail',
    components:{
     headNav,
     footCom,
  },
    data(){
      return{
         id:'',
         info:{}
      }
    },
    created(){
      this.id = this.$route.query.id
      this.getDetail()
    },
    methods:{
        getDetail(){
          // 获取文章详情数据
          this.$axios.get('https://eduvideo.hangzhou.com.cn/api/v1/get_works/'+this.id).then(res=>{
            if(res.data.status =='success'){
              this.info = res.data.data
            }
        
      })
        }
    }
  }
</script>
  
  <!-- Add "scoped" attribute to limit CSS to this component only -->
  <style scoped>
  .art{
    width: 1200px;
    height: auto;
  }
  .con_body{
    width: 100%;
    height: auto;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-bottom: 100px;
  }
  .head{
    width: 100%;
    height: 464px;
    background: url('./../static/images/banner.jpg') no-repeat center top;
  }
  .content{
    width: 100%;
    height: auto;
    background-size: 100% 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
  }
  .art_top{
    width: 100%;
    height: 180px;
    border-bottom: 1px solid #d8d8d8;
    padding-top: 70px;
    box-sizing: border-box;
  }
  .art_tit{
    color: #272727;
    font-size: 36px;
    font-weight: bolder;
    margin: 0;
    padding: 0;
   
  }
  .date{
    color: #272727;
    font-size: 18px;
    margin: 0;
    padding: 0;
    margin-top: 30px;
  }
  .art_mid{
   width: 100%;
   height: auto;
   display: flex;
   flex-direction: column;
   justify-content: center;
   align-items: center;
   margin: 50px 0;
  }
  .auth{
    font-size: 16px;
    color: #272727;
    font-weight: bolder;
    margin: 15px 0;
  }
  .auth_lm{
    font-size: 16px;
    color: #272727;
    margin: 15px 0;
  }
  .desp{
    font-size: 16px;
    color: #272727;
    margin: 0;
    padding: 0;
    line-height: 30px;
  }
  .whdr{
    background-color: #6275d3;
    color: #fff;
    border-radius: 15px;
    width: 90px;
    height: 30px;
    text-align: center;
    line-height: 30px;
    margin-left: 30px;
    font-size: 16px;
  }
  .dr_div{
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
  }
  </style>
  